<template>
    <el-container id="toolswidget" class="mev-div-border" style="width: 300px;position: fixed;top: 100px;right:10px">
        <el-main>
            <el-row>
                <el-col :span="4"> XYZ </el-col>
                <el-col :span="20" >
                    <el-input size="mini" v-model="m_xyz"></el-input>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="4"> LLH </el-col>
                <el-col :span="20" >
                    <el-input size="mini" v-model="m_llh"></el-input>
                </el-col>
            </el-row>

            <el-row>
                <el-button @click="clickfun" size="medium">XYZ-LLH</el-button>
                <el-button @click="clickfun2" size="medium">LLH-XYZ</el-button>
            </el-row>
            <el-row>
                <el-col :span="4"> FOV </el-col>
                <el-col :span="12" >
                    <el-input size="mini" v-model="m_fov"></el-input>
                </el-col>
                <el-button @click="clickfov" size="medium">OK</el-button>
            </el-row>
            <el-row>
                <el-col :span="4"> 相机坐标系 </el-col>
                <el-col :span="12" >
                    <el-input size="mini" v-model="m_camerapos"></el-input>
                </el-col>
                <el-button @click="clickcamerapos" size="medium">CW</el-button>
                <el-button @click="click_WC" size="medium">WC</el-button>
            </el-row>
        </el-main>
    </el-container>

</template>

<script>
    import Tools from "./Tools"
    export default {
        name: "ToolsWidget",
        data() {
            return {
                m_xyz:"",
                m_llh:"",
                m_fov:90,
                m_camerapos:""
            };
        },
        mounted() {
            this.$nextTick().then(() => {
                Tools.initTools();
            });
        },
        methods:{
            clickfun(){
                this.m_llh = Tools.convertXYZ2LLH(this.m_xyz);
            },
            clickfun2(){
                this.m_xyz = Tools.convertLLH2XYZ(this.m_llh);
            },
            clickfov(){
                Tools.setFov(this.m_fov);
            },
            clickcamerapos(){
                Tools.setCameraPos(this.m_camerapos);
            },
            click_WC(){
                Tools.setW2C(this.m_camerapos);
            }
        }
    }
</script>

<style scoped>

</style>